@extends('layouts.app', ['activePage' => 'note', 'titlePage' => __('手记管理')])

@section('content')
  <div class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-md-12">
          <div class="card">
            <div class="card-header card-header-primary">
              <h4 class="card-title ">{{ __('手记列表') }}</h4>
              <p>手记查看/标记精品/删除手记</p>
            </div>
            <div class="card-body">
              @if (session('status'))
                <div class="row">
                  <div class="col-sm-12">
                    <div class="alert alert-success">
                      <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                        <i class="material-icons">close</i>
                      </button>
                      <span>{{ session('status') }}</span>
                    </div>
                  </div>
                </div>
              @endif
              <div class="table-responsive">
                <table class="table">
                  <thead class="text-primary text-center">
                  <th>编号</th>
                  <th>发布人</th>
                  <th>内容</th>
                  <th>发表时间</th>
                  <th>操作</th>
                  </thead>
                  <tbody>
                  @foreach($note as $note)
                    <tr class="text-center">
                      <td>
                        {{ $loop->iteration }}
                      </td>
                      <td>
                        {{ $note->user->nickname }}
                      </td>
                      <td>
                        {{ $note->content }}
                      </td>
                      <td>
                        {{ $note->create_time }}
                      </td>
                      <td class="td-actions">
                          <a href="note/{{$note->id}}" class="btn btn-sm btn-danger" data-toggle="tooltip"  data-placement="top" title="移除该条手记">
                            <i class="material-icons">close</i>
                          </a>
                      </td>
                    </tr>
                  @endforeach
                  </tbody>
                </table>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
@endsection
